home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-23 | 800 b | 29 lines | [TEXT/UNIX] |
- /* stdarg.h for GNU.
- Note that the type used in va_arg is supposed to match the
- actual type **after default promotions**.
- Thus, va_arg (..., short) is not valid. */
-
- #ifndef _M_STDARG_H
- #define _M_STDARG_H
-
- #include <stddef.h>
-
- /* Amount of space required in an argument list for an arg of type TYPE.
- TYPE may alternatively be an expression whose type is used. */
-
- #define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-
- #define va_start(AP, LASTARG) \
- (AP = (((char *) &LASTARG)+__va_rounded_size(LASTARG)))
-
- #define va_end(AP)
-
- #define va_arg(AP, TYPE) \
- (*((TYPE *) (AP += __va_rounded_size (TYPE), \
- AP - (sizeof (TYPE) < 4 ? sizeof (TYPE) \
- : __va_rounded_size (TYPE)))))
-
- #endif /* _M_STDARG_H */
-
-